home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 3.iso / dist / fw_qt3.idb / usr / freeware / Qt / include / qt_x11.h.z / qt_x11.h
C/C++ Source or Header  |  2002-04-08  |  6KB  |  232 lines

  1. /****************************************************************************
  2. ** $Id$
  3. **
  4. ** Includes X11 system header files.
  5. **
  6. ** Created : 981123
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the kernel module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses for Unix/X11 may use this file in accordance with the Qt Commercial
  23. ** License Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QT_X11_H
  39. #define QT_X11_H
  40.  
  41.  
  42. //
  43. //  W A R N I N G
  44. //  -------------
  45. //
  46. // This file is not part of the Qt API.  It exists for the convenience
  47. // of q*_x11.cpp.  This header file may change from version to version
  48. // without notice, or even be removed.
  49. //
  50. //
  51.  
  52.  
  53. #include "qwindowdefs.h"
  54.  
  55. // the following is necessary to work around breakage in many versions
  56. // of XFree86's Xlib.h still in use
  57. // ### which versions?
  58. #if defined(_XLIB_H_) // crude hack, but...
  59. #error "cannot include <X11/Xlib.h> before this file"
  60. #endif
  61. #define XRegisterIMInstantiateCallback qt_XRegisterIMInstantiateCallback
  62. #define XUnregisterIMInstantiateCallback qt_XUnregisterIMInstantiateCallback
  63. #define XSetIMValues qt_XSetIMValues
  64. #include <X11/Xlib.h>
  65. #undef XRegisterIMInstantiateCallback
  66. #undef XUnregisterIMInstantiateCallback
  67. #undef XSetIMValues
  68.  
  69. #include <X11/Xutil.h>
  70. #include <X11/Xos.h>
  71. #include <X11/Xatom.h>
  72.  
  73.  
  74. //#define QT_NO_SHAPE
  75. #ifdef QT_NO_SHAPE
  76. #define XShapeCombineRegion(a,b,c,d,e,f,g)
  77. #define XShapeCombineMask(a,b,c,d,e,f,g)
  78. #else
  79. #include <X11/extensions/shape.h>
  80. #endif // QT_NO_SHAPE
  81.  
  82.  
  83. // the wacom tablet (currently just the IRIX version)
  84. #if defined (QT_TABLET_SUPPORT)
  85. #  include <X11/extensions/XInput.h>
  86. #if defined (Q_OS_IRIX)
  87. #  include <wacom.h>  // wacom driver defines for IRIX (quite handy)
  88. #endif
  89. #endif // QT_TABLET_SUPPORT
  90.  
  91.  
  92. // #define QT_NO_XINERAMA
  93. #ifndef QT_NO_XINERAMA
  94. #  if 0 // ### Xsun, but how to detect it?
  95. // Xinerama is only supported in Solaris 7 with patches 107648/108376 and
  96. // Solaris 8 or above which introduce the X11R6.4 Xserver.
  97. // To switch the Xinerama functionality on, you need to add the "+xinerama"
  98. // argument to the Xsun start line.
  99. // At least Solaris 7 and 8 are missing Xinerama system headers and function
  100. // declarations (bug 4284701).
  101. // The Xinerama API is not documented. In theory it could change but it
  102. // probably won't because Sun are using it in at least dtlogin (bug 4221829).
  103. extern "C" Bool XPanoramiXQueryExtension(
  104.     Display*,
  105.     int*,
  106.     int*
  107. );
  108. extern "C" Status XPanoramiXQueryVersion(
  109.     Display*,
  110.     int*,
  111.     int*
  112. );
  113. extern "C" Status XPanoramiXGetState(
  114.     Display*,
  115.     Drawable,
  116.     XPanoramiXInfo*
  117. );
  118. extern "C" Status XPanoramiXGetScreenCount(
  119.     Display *,
  120.     Drawable,
  121.     XPanoramiXInfo*
  122. );
  123. extern "C" Status XPanoramiXGetScreenSize(
  124.     Display*,
  125.     Drawable,
  126.     int,
  127.     XPanoramiXInfo*
  128. );
  129. #  else // XFree86
  130. // XFree86 does not C++ify Xinerama (at least up to XFree86 4.0.3).
  131. extern "C" {
  132. #    include <X11/extensions/Xinerama.h>
  133. }
  134. #  endif
  135. #endif // QT_NO_XINERAMA
  136.  
  137.  
  138. // #define QT_NO_XRENDER
  139. #ifndef QT_NO_XRENDER
  140. #  include <X11/extensions/Xrender.h>
  141. // #define QT_NO_XFTFREETYPE
  142. #  ifndef QT_NO_XFTFREETYPE
  143. #    include <X11/Xft/XftFreetype.h>
  144. #  endif // QT_NO_XFTFREETYPE
  145. #else
  146. // make sure QT_NO_XFTTREETYPE is defined if QT_NO_XRENDER is defined
  147. #  ifndef QT_NO_XFTFREETYPE
  148. #    define QT_NO_XFTFREETYPE
  149. #  endif
  150. #endif // QT_NO_XRENDER
  151.  
  152.  
  153. #ifndef QT_NO_XKB
  154. #  include <X11/XKBlib.h>
  155. #endif // QT_NO_XKB
  156.  
  157.  
  158. #if !defined(XlibSpecificationRelease)
  159. #  define X11R4
  160. typedef char *XPointer;
  161. #else
  162. #  undef X11R4
  163. #endif
  164.  
  165. // #define QT_NO_XIM
  166. #if defined(X11R4)
  167. // X11R4 does not have XIM
  168. #define QT_NO_XIM
  169. #elif defined(Q_OS_OSF) && (XlibSpecificationRelease < 6)
  170. // broken in Xlib up to OSF/1 3.2
  171. #define QT_NO_XIM
  172. #elif defined(Q_OS_AIX)
  173. // broken in Xlib up to what version of AIX?
  174. #define QT_NO_XIM
  175. #elif defined(Q_OS_SOLARIS)
  176. // XRegisterIMInstantiateCallback broken under "C" locale on Solaris
  177. #define QT_NO_XIM
  178. #elif defined(QT_NO_DEBUG) && defined(Q_OS_IRIX) && defined(Q_CC_EDG)
  179. // XCreateIC broken when compiling -64 on IRIX 6.5.2
  180. #define QT_NO_XIM
  181. #elif defined(Q_OS_HPUX) && defined(__LP64__)
  182. // XCreateIC broken when compiling 64-bit ELF on HP-UX 11.0
  183. #define QT_NO_XIM
  184. #elif defined(Q_OS_SCO)
  185. // suggested by user...
  186. #define QT_NO_XIM
  187. #endif // QT_NO_XIM
  188.  
  189.  
  190. #if !defined(QT_NO_XIM) && (XlibSpecificationRelease >= 6)
  191. #define USE_X11R6_XIM
  192.  
  193. //######### XFree86 has wrong declarations for XRegisterIMInstantiateCallback
  194. //######### and XUnregisterIMInstantiateCallback in at least version 3.3.2.
  195. //######### Many old X11R6 header files lack XSetIMValues.
  196. //######### Therefore, we have to declare these functions ourselves.
  197.  
  198. extern "C" Bool XRegisterIMInstantiateCallback(
  199.     Display*,
  200.     struct _XrmHashBucketRec*,
  201.     char*,
  202.     char*,
  203.     XIMProc, //XFree86 has XIDProc, which has to be wrong
  204.     XPointer
  205. );
  206.  
  207. extern "C" Bool XUnregisterIMInstantiateCallback(
  208.     Display*,
  209.     struct _XrmHashBucketRec*,
  210.     char*,
  211.     char*,
  212.     XIMProc, //XFree86 has XIDProc, which has to be wrong
  213.     XPointer
  214. );
  215.  
  216. extern "C" char *XSetIMValues( XIM /* im */, ... );
  217.  
  218. #endif
  219.  
  220.  
  221. #ifndef X11R4
  222. #  include <X11/Xlocale.h>
  223. #endif // X11R4
  224.  
  225.  
  226. #ifdef QT_MITSHM
  227. #  include <X11/extensions/XShm.h>
  228. #endif // QT_MITSHM
  229.  
  230.  
  231. #endif // QT_X11_H
  232.